﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
request.setCharacterEncoding("UTF-8");
String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<link rel="shortcut icon" href="image/favicons.ico" type="image/x-icon" />
<link rel="stylesheet" href="<%=basePath%>common/default/default.css" />
<link rel="stylesheet"
	href="<%=basePath%>common/plugins/code/prettify.css" />
<script charset="utf-8" src="<%=basePath%>common/lang/kindeditor.js"></script>
<script charset="utf-8" src="<%=basePath%>common/lang/zh_CN.js"></script>
<script charset="utf-8"
	src="<%=basePath%>common/plugins/code/prettify.js"></script>
<!-- Main content -->
<section class="content" id="refundcontent">
<div class="row">
	<div class="col-md-12">

		<div class="box box-danger">
			<div class="box-header">

				<section class="content-header">
				<h1>
					<ol class="breadcrumb">
						<li>
							<a href="<%=basePath%>admin/lianjie"><i
								class="fa fa-th-list fa-lg"></i>列表</a>
						</li>
						<li>
							添加链接
						</li>
					</ol>
				</h1>


				</section>
			</div>
			<div class="box-body">
				<!-- phone mask -->
				<div class="form-group">

					<div class="bg-info" style="padding: 10px;">
						<c:forEach items="${map}" var="v">
							<a href="<%=basePath%>admin/download?filename=${v.key}">${v.value}</a>
							<br />
						</c:forEach>
						<br />
						<a href="<%=basePath%>admin/xz">上传文件</a>
						<p>
							<!--<form method="POST" action="提交地址" name="frm"
								enctype="multipart/form-data">
								<input type="file" name="accessory" />
								<br>
								<input type="submit" onclick="return checkacc();" />
								<br>
							</form>
							
						-->
						</p>
					</div>
					<div class="form-group">

					</div>
					<!-- /.form group -->
				</div>
				<!-- /.form group -->

			</div>
			<!-- /.box-body -->
		</div>
		<!-- /.box -->

	</div>
	<!-- /.col (left) -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->

<script type="text/javascript">
     		  
		$("#fileupload_input").fileupload({
		    url:"<%=basePath%>admin/uploadImg",
		    done:function(e,result){
					
		          $("#img").attr("src",result.result.entity);
		          $("#picurl").val(result.result.entity);
		      
		    }
		});
		
		function checkacc(){
    var postfix = frm.accessory.value.substring(frm.accessory.value.lastIndexOf(".")+1); //获得选择的上传文件的后缀名的正则表达式 
     if(postfix!=""){
          if(!(postfix == "jpg"||postfix == "pdf"))  
          {  
      alert('文件类型不正确，请选择.jpg或者.pdf文件 ！');  
      document.getElementById('accessory').value="";
      document.getElementById('accessory').focus();
      return false;  
          } 
     }
}
     </script>